import React from 'react';
// import  { Component } from 'react';
import './index.css';

// 热点页面左边的图标
export default class HotDetailArticle extends React.Component{
    constructor(props){
        super();
        this.state={
            src:props.src,
            title:props.title,
            text:props.text,
            subtext:props.subtext,
            time:props.time
        }
    }

    UNSAFE_componentWillReceiveProps(props){
        this.setState({
            src:props.src,
            title:props.title,
            text:props.text,
            subtext:props.subtext,
            time:props.time
        });
    }

    render(){
        return(
            <div className="HotDetailArticle_Body">
                <div className="HotDetailArticle_Title">
                    {this.state.title}
                </div>
                <div className="HotDetailArticle_Time">
                    <div className="HotRightInfo_R_B_I">
                        <img src="/assets/Hot/time.png" alt="time"/>
                    </div>
                    <div className="HotRightInfo_R_B_t">
                        {this.state.time}
                    </div>
                </div>
                <div className="HotDetailArticle_text_t">
                    {this.state.text}
                </div>
                <div className="HotDetailArticle_Img">
                    <img src={this.state.src} alt="article"/>
                </div>
                
                <div className="HotDetailArticle_text_b" dangerouslySetInnerHTML={{__html: this.state.subtext}}>
                    {/* {this.state.subtext} */}
                </div>
            </div>
        )
    }
}